kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-hub/CRoaring
    REF "v${VERSION}"
    SHA512 d7dcce5a3b2f548a0690936c1ad43b5bb4661512d84493f4c7907505d3a320217a9ee3133ae627251abc9d357e8540ee6a40eaf212e714a51d9c7561902d25aa
    HEAD_REF master
)


string(COMPARE EQUAL "${KMPKG_LIBRARY_LINKAGE}" "static" ROARING_BUILD_STATIC)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    DISABLE_PARALLEL_CONFIGURE
    OPTIONS
        -DROARING_BUILD_STATIC=${ROARING_BUILD_STATIC}
        -DENABLE_ROARING_TESTS=OFF
)

kmpkg_cmake_install()

kmpkg_copy_pdbs()

kmpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/roaring)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

kmpkg_fixup_pkgconfig()

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
